import React, { Component } from 'react';

import { withRouter,NavLink} from 'react-router-dom';
import {observer,inject} from 'mobx-react';


@withRouter
@inject('PageGx')
@observer
class Com extends Component{
    constructor(props){
        super(props);
        this.state = {
            ajaxCfg:{
                url:'/home/mediareports',
                cfg:{
                    page_number:'1',
                    page_size:'10',
                },
                headers:{

                }
            }
        }
    }
    // 调取拼多多
    getList(ajaxCfg){
        const { getPdd } = this.props.PageGx;
        getPdd(ajaxCfg);
    }
    componentDidMount(){
        // this.init()
        this.getList(this.state.ajaxCfg)
    }

    lists(){
        const { pddList } = this.props.PageGx;
        const lists = pddList.map((val,index)=>{
            return(
                <li key={val.id}>{val.id}内容</li>
            )
        })
        return lists;
    }
    render(){
        const { pddList } = this.props.PageGx
        return(
            <div className="k_header">
                {pddList.length!==0 ? this.lists() : ''}
            </div>
        )
    }

}


export default Com;
